﻿@using Hsp.WebNovels.Web.Models
@using Hsp.WebNovels.Model.Models
@using Hsp.WebNovels.Common.Constants
@model WebSiteViewModel

@{
    ViewData["Title"] = "站点管理";
}

@*<div class="text-center" hidden>
    <h1 class="display-4">Welcome</h1>
    <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>*@

<div class="row-fluid">

    <div class="page-header">
        <h5 class="pull-left">
            <i class="glyphicon glyphicon-list"></i>
            <span>站点管理</span>
        </h5>
        <div class="pull-right">
            <ul class="breadcrumb">
                <li class="breadcrumb-item">
                    <a href="#"><i class="fa fa-home"></i>首页</a>
                </li>
                <li class="separator">
                    <i class="fa fa-angle-right"></i>
                </li>
                <li class="breadcrumb-item active">站点管理</li>
            </ul>
        </div>
    </div>

@*    <form class="d-flex flex-row align-items-center flex-wrap" hidden>
        <label class="my-1 me-2" for="inlineFormCustomSelectPref">Preference</label>
        <select class="form-select my-1 me-sm-2 w-auto" id="inlineFormCustomSelectPref">
            <option selected>Choose...</option>
        </select>
        <div class="form-check my-1 me-sm-2">
            <input type="checkbox" class="form-check-input" id="customControlInline" />
            <label class="form-check-label" for="customControlInline">Remember my preference</label>
        </div>

        <button type="submit" class="btn btn-primary my-1">Submit</button>
    </form>*@

    @*  form-inline form-toolbar col-md-2 col-md-4 form-control-sm form-control-sm role="form" *@

    <div id="toolbar">
        <div class="d-flex align-items-center form-toolbar">
            @*<form class="d-flex form-toolbar"></form>*@
                <input name="search" class="col-2 form-control form-control-sm" type="text" placeholder="搜索">
                <div class="input-group input-group-sm col-2">
                <input id="startDate" name="startDate" class="form-control form-control-sm" type="date" style="margin-right: 0 !important;" data-toggle="tooltip" data-placement="top" title="开始日期" />
                    <div class="input-group-text form-control-sm">至</div>
                    <input id="endDate" name="endDate" class="form-control form-control-sm" type="date" data-toggle="tooltip" data-placement="top" title="结束日期" />
                </div>

            <div class="col-8">
                    <button id="remove" class="btn btn-sm btn-danger" disabled>
                        <i class="glyphicon glyphicon-remove"></i>批量删除
                    </button>
                    <button id="btnAdd" class="btn btn-sm btn-primary">
                        <i class="glyphicon glyphicon-plus"></i>添加站点
                    </button>
                    <div class="btn-group" role="group" aria-label="query group">
                        <button id="btnSearch" class="btn btn-sm btn-primary" style="margin-right: 0!important;">
                            <i class="glyphicon glyphicon-search" aria-hidden="true"></i>查询
                        </button>
                        <button id="btnClear" type="reset" class="btn btn-secondary btn-sm" title="清空查询条件">
                            <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                        </button>
                    </div>
                </div>
        </div>
    </div>

    <div class="table-responsive">
        <table id="website-table" class="table table-striped table-sm table-hover" data-toggle="table" data-toolbar="#toolbar"></table>
    </div>

</div>

<!-- 站点编辑模态窗体 //-->
<div class="modal fade" id="editModel" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="editModelLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-scrollable modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h1 class="modal-title fs-5" id="editModelLabel">站点编辑</h1>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">


                <form class="form-horizontal">
                    <input type="hidden" asp-for="Id" />
                    <div class="mb-3 row">
                        <label asp-for="Name" class="col-3 col-form-label col-form-label-sm required"></label>
                        <div class="col-9">
                            <input asp-for="Name" class="form-control form-control-sm" />
                            <span asp-validation-for="Name" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="WebUrl" class="col-3 col-form-label col-form-label-sm required"></label>
                        <div class="col-9">
                            <input asp-for="WebUrl" class="form-control form-control-sm" />
                            <span asp-validation-for="WebUrl" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="AddressObject" class="col-3 col-form-label col-form-label-sm"></label>
                        <div class="col-9">
                            <input asp-for="AddressObject" class="form-control form-control-sm" />
                            <span asp-validation-for="AddressObject" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="AddressNext" class="col-3 col-form-label col-form-label-sm"></label>
                        <div class="col-9">
                            <input asp-for="AddressNext" class="form-control form-control-sm" />
                            <span asp-validation-for="AddressNext" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="ContentObject" class="col-3 col-form-label col-form-label-sm"></label>
                        <div class="col-9">
                            <input asp-for="ContentObject" class="form-control form-control-sm" />
                            <span asp-validation-for="ContentObject" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="ContentNext" class="col-3 col-form-label col-form-label-sm"></label>
                        <div class="col-9">
                            <input asp-for="ContentNext" class="form-control form-control-sm" />
                            <span asp-validation-for="ContentNext" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="Encoding" class="col-3 col-form-label col-form-label-sm required"></label>
                        <div class="col-9">
                            <input asp-for="Encoding" class="form-control form-control-sm" />
                            <span asp-validation-for="Encoding" class="text-danger"></span>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="UrlCombine" class="col-3 col-form-label col-form-label-sm"></label>
                        <div class="col-9">
                            <select asp-for="UrlCombine" class="form-control form-control-sm" asp-items="Html.GetEnumSelectList<EnumUrlCombine>()"></select>
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label asp-for="AnnotationType" class="col-3 col-form-label col-form-label-sm"></label>
                        <div class="col-3">
                            <select asp-for="AnnotationType" class="form-control form-control-sm" asp-items="Html.GetEnumSelectList<EnumAnnotationType>()"></select>
                        </div>
                        <label asp-for="Valid" class="col-3 col-form-label col-form-label-sm"></label>
                        <div class="col-3">
                            <select asp-for="Valid" class="form-control form-control-sm" asp-items="Html.GetEnumSelectList<EnumValid>()"></select>
                        </div>
                    </div>
                    <input type="hidden" asp-for="CreateTime" />
                    <input type="hidden" asp-for="UpdateTime" />

                </form>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-sm btn-secondary" data-bs-dismiss="modal">
                    <i class="glyphicon glyphicon-floppy-remove" aria-hidden="true"></i>关闭
                </button>
                <button type="button" class="btn btn-sm btn-primary" id="btnSave">
                    <i class="glyphicon glyphicon-floppy-saved" aria-hidden="true"></i>保存
                </button>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
    <environment names="Development">
        <link href="~/view-resources/WebSites/TableList.css" rel="stylesheet" asp-append-version="true" />
        <script src="~/view-resources/WebSites/TableList.js" asp-append-version="true"></script>
    </environment>

    <environment names="Staging,Production">
        <link href="~/view-resources/WebSites/TableList.min.css" rel="stylesheet" asp-append-version="true" />
        <script src="~/view-resources/WebSites/TableList.min.js" asp-append-version="true"></script>
    </environment>

    <style type="text/css">
        .form-inline form {
            /*display: none!important;*/
        }

        input[name='search']{
            width: 12rem;
        }

        input[type=date] {
            width: 0 !important;
        }

        .form-toolbar{

        }

    </style>

    <script type="text/javascript">

    </script>

}
